package com.xdclass.controller;

import com.xdclass.VO.UserVO;
import com.xdclass.service.dubbo.UserServiceImpl;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:TestController Package:com.xdclass.controller Description:
 *
 * @Date:2021/7/1 10:31
 * @Author:sunzheng@beiming.com
 */
@RestController
@RequestMapping("/user/api/v1")
public class UserController {

  @Resource
  private UserServiceImpl userServiceImpl;

  @GetMapping("/get_user")
  public UserVO getUserById(@RequestParam("id") Integer id) {
    if (id == null || id == 0) {
      return new UserVO();
    }
    return userServiceImpl.getUserById(id);
  }
}
